home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / ZipCheck.cpt / zipCheck.docs < prev    next >
Text File  |  1989-02-26  |  2KB  |  54 lines

  1. ==================================================================
  2. zipCheck HyperCard XFCN
  3. © Copyright 1988 by Sam Thornton
  4. ==================================================================
  5.  
  6. zipCheck checks a zipcode against a list of the 895 valid 3-digit
  7. zip areas in the 50 states (as of 1/88) and returns the correct
  8. state abbreviation for the target area.
  9.  
  10. The zipcode's format must be either 5 TEXT characters (e.g.,
  11. "68938"), or 10 TEXT characters (e.g., "68938-0123").
  12.  
  13. If there is either a format error in the entered zipcode, or if
  14. there is no corresponding 3-digit zip area, zipCheck beeps and
  15. returns a null string instead of a state abbreviation.
  16.  
  17. This allows you to either generate correct state abbreviations
  18. based on an entered zipcode, or crosscheck zipcodes against an
  19. entered state abbreviation.
  20. ==================================================================
  21. Syntax:
  22.  
  23.           get zipCheck(<"zipcode">); or
  24.  
  25.           get zipCheck(<field "fieldname">)
  26.  
  27. The return is the correct state abbreviation for the entered
  28. zipcode or, in the case of an error, an empty string.
  29.  
  30. Sample HyperCard script (for a zipcode entry field):
  31.  
  32. on closeField
  33.    get zipCheck (bkgnd field "ZipCode")
  34.    if it is not empty then
  35.       put it into bkgnd field "State"
  36.    else
  37.       put empty into bkgnd field "ZipCode"
  38.       answer "Sorry, entered zipcode is invalid..."
  39.    end if
  40.    pass closeField
  41. end closeField
  42.  
  43. ==================================================================
  44.  
  45. Use ResEdit to install zipCheck into any stack. Installing in your
  46. Home stack will make it available from all other stacks.
  47.  
  48. ================================================================== 
  49.  
  50. May be copied & distributed without charge only, except for nominal
  51. copying and distribution costs. Not for commercial sale or resale.
  52. See the "zipCheck.c" file for source listing.  
  53. ================================================================== 
  54.